NotesWhat is notes.io?

Notes brand slogan

Notes - notes.io

<Routine name="storeInSharepoint">
<Parm name="dataIn" datatype="StoreInSharepointIn"/>
<Field name="dataOut" datatype="StoreInSharePointOut"/>
<Field name="statusMessage" datatype="StatusMessage"/>
<Set var="dataOut.status.result" value="'Processed'"/>
<Try>
[STEP] - retrieve folder details from CRM document locations
<Field name="crmlink" dft=" '/' + getProjectName() + '/Base/Objects/XperiDo.crmlink'"/>
// parent entity is provided when the document is created as part of an subgrid.
// by default location is determined based upon the selected entity.
<Field name="subWeb" datatype="string"/>
// extract spmd_ prefixed dynamicfields, prepare them to be add as metadata
<FieldList name="allMetaData" datatype="json"/>
<ForEach in="dataIn.dynamicFieldList" var="dynamicField">
<If condition="startsWith(dynamicField.fieldName, 'spmd_')">
<Field name="metadata" datatype="json"/>
<Set var="metadata.name" value="substr(dynamicField.fieldName, 5, length(dynamicField.fieldName))"/>
<Set var="metadata.value" value="dynamicField.fieldValue"/>
<Set var="allMetaData[]" value="metadata"/>
</If>
</ForEach>
// get sharepoint hostname
<Field name="sharepointServer" datatype="string" dft="external(getProjectName()+'/mssharepoint.SharePointServer')"/>
<Field name="url"/>
<LoadXmlDoc var="sharepointServer" access="'DOM'"/>
<Select xpath="'MsSharePointAddFolder/SharePointServer'">
<Set var="url" value="$@url"/>
</Select>
<CloseXmlDoc/>
<Field name="i" datatype="int" dft="indexOf(substr(url,8,length(url)),'/')+8"/>
<Field name="hostname" datatype="string" dft="substr(url,0,i)"/>
// get sharepoint folder location we stored in this dynamic field
<Field name="spurlFolder" datatype="string"/>
<ForEach in="dataIn.dynamicFieldList" var="dynamicField">
<If condition="dynamicField.fieldName eq 'XDTemplate'">
<Set var="spurlFolder" value="dynamicField.fieldValue"/>
</If>
</ForEach>
<Field name="spurl" datatype="string" dft="hostname+'/workspaces/1/MBsalesCRM/Lists/documents/'+spurlFolder"/>
<MsSharePointAddFile filename="dataIn.name" server="'SharePointServer'" parentFolder="spurl" createParent="true" subWeb="subWeb" overwrite="true">
<Metadata list="allMetaData"/>
<Input file="dataIn.document"/>
</MsSharePointAddFile>
// store document location in output parameter
<Set var="dataOut.SharePointUrl" value="spurl+'/'+dataIn.name"/>
// when the folder is created in the save process. Add folder locations into the CRM document entities.
<Set var="statusMessage.messageType" value="'Info'" />
<Set var="statusMessage.message" value="'document ' + dataIn.name + ' stored in SharePoint'"/>
<Set var="statusMessage.processStep" value="'storeInSharepoint'"/>
<Set var="statusMessage.messageData" value="dataOut.SharePointUrl"/>
<Set var="dataOut.status.messages[]" value="statusMessage"/>
<Catch var="xe">
<Log msg="xe" level="'error'"/>
<Set var="dataOut.status.result" value="'Failed'"/>
<Set var="statusMessage.messageType" value="'Error'"/>
<Set var="statusMessage.message" value="xe.message"/>
<Set var="statusMessage.processStep" value="'storeInSharepoint'"/>
<Set var="statusMessage.messageData" value="null"/>
// remove CRM exception
<Field name="idx" datatype="int" dft="indexOf(statusMessage.message,'CRM Exception:' )"/>
<If condition="idx ne -1">
<Set var="statusMessage.message" value="substr( statusMessage.message, idx, length(xe.message))"/>
</If>
// remove Errorcode indication
<Set var="statusMessage.message" value="replace( statusMessage.message, 'Errorcode: 0 =&gt; ', '')"/>
<Set var="dataOut.status.messages[]" value="statusMessage"/>
</Catch>
</Try>
<Return value="dataOut"/>
</Routine>
     
 
what is notes.io
 

Notes.io is a web-based application for taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000 notes created and continuing...

With notes.io;

  • * You can take a note from anywhere and any device with internet connection.
  • * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
  • * You can quickly share your contents without website, blog and e-mail.
  • * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
  • * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.

Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.

Easy: Notes.io doesn’t require installation. Just write and share note!

Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )

Free: Notes.io works for 12 years and has been free since the day it was started.


You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;


Email: [email protected]

Twitter: http://twitter.com/notesio

Instagram: http://instagram.com/notes.io

Facebook: http://facebook.com/notesio



Regards;
Notes.io Team

     
 
Shortened Note Link
 
 
Looding Image
 
     
 
Long File
 
 

For written notes was greater than 18KB Unable to shorten.

To be smaller than 18KB, please organize your notes, or sign in.