DocuSign API how to sync tags in template with Salesforce fields - api

I'm trying to send a document from a template using SOAP APi in Salesforce. I used the code walkthrough NDA kiosk as an example. I can pre-set the values but the value of the fields isn't written back to Salesforce. When I send the document from DocuSign button the values are synced as expected.
// Add data for fields
DocuSignAPI.TemplateReferenceFieldDataDataValue fd1 = new DocuSignAPI.TemplateReferenceFieldDataDataValue();
fd1.TabLabel = 'Full Name 1';
fd1.Value = recipient.UserName;
ndaTemplate.FieldData = new DocuSignAPI.TemplateReferenceFieldData();
ndaTemplate.FieldData.DataValues = new DocuSignAPI.ArrayOfTemplateReferenceFieldDataDataValue();
ndaTemplate.FieldData.DataValues.DataValue = new DocuSignAPI.TemplateReferenceFieldDataDataValue[1];
ndaTemplate.FieldData.DataValues.DataValue[0] = fd1;
//LINK THE Object with custom field
DocusignNetApi.CustomField field = new DocusignNetApi.CustomField ();
//field.Name = 'DSFSSourceObjectId';
field.Name = '##SFCustom_Object__c';
field.Value = pCustomObjectId;
field.Show = 'false';
DocusignNetApi.ArrayOfCustomField arrayOfCustomField = new DocusignNetApi.ArrayOfCustomField();
arrayOfCustomField.CustomField = new DocusignNetApi.CustomField[1];
arrayOfCustomField.CustomField[0] = field;
pEnvelopeInformation.CustomFields = arrayOfCustomField;
I do set external object ID in the custom fields and the envelope and recipient status are related to my custom object. I'm not really sure how to achieve what I want. Can someone refer me to a doc?

I found a better way. Thank you for your answer it lead me to a better solution.
For anybody else who struggles with docusign API here is how to do it.
What we did so far was good. The problem with custom field is you can't reference it in custom button. So I wasn't able to see attachments directly on my custom object.
I changed the mapping to point to External Source Id instead of the custom field.
I sent a document with custom button from Salesforce and I used API explorer to get envelope assets - custom fields. This was the result. This is how SourceId from the button was mapped.
{
"fieldId": "84508346",
"name": "DSFSSourceObjectId",
"show": "false",
"required": "false",
"value": "a2H11000001XXXX~My_Custom_Object__c"
},
I changed my code that created the custom field to contain the object name after the ID.
Now I can see attachments when I send the document via API and from button click.
Enjoy all good people!

I do not believe there is actual documentation on the process via the DS API, but you have it correct that you want the objectID to be an envelope custom field. The envelope custom field should be named "##SF{objectID}" so for an Opp it would be ##SFOpportunity.
You'll also need to map back the custom object to the custom field in Connect (via the DS web app), the screenshot is using Quotes, but it should be the same for any custom object.
Also if you want the DocuSign Status on that custom object instructions to map it back can be found here. I think the Status will come back properly despite being sent from the API as opposed to the DocuSign for Salesforce manage package.

Related

GA4 ecommerce items Array do not show up in debug mode

GA4 ecommerce items Array do not show up in debug mode
i am using the GTM, i am sure i passed the Array for items (using Datalayer or CJS), but GA4 does not recognized it , what i see is missing the items tab in debug mode, i don't know how that could be show up , am i doing something wrong? anyone has the same experience?
Looks like the event name is incorrect here -> View_Items.
Make sure that the event name exactly matches view_item
(stylized as snake_case).
As GA4 only allows ecommerce data collection with a set of pre-defined
event names.
Update :
I saw this checkbox is being checked
As you already set the value currency items in the event parameter. You can uncheck this setting.
I think you can follow Google's document about it
view_item_details
items: [
{
item_id: "SKU_12345",
item_name: "Stan and Friends Tee",
affiliation: "Google Merchandise Store",
coupon: "SUMMER_FUN",
currency: "USD",
discount: 2.22,
index: 0,
item_brand: "Google",
item_category: "Apparel",
item_category2: "Adult",
item_category3: "Shirts",
item_category4: "Crew",
item_category5: "Short sleeve",
item_list_id: "related_products",
item_list_name: "Related Products",
item_variant: "green",
location_id: "ChIJIQBpAG2ahYAR_6128GcTUEo",
price: 9.99,
quantity: 1
}
]
Make items array only contain 1 item
Google has a list of recommended events suggesting that the items are automatically collected. If your custom event name doesn't match the listed event, GA4 won't take the items data.
Note that even though you can use the GTM preview mode to check whether the data is correctly constructed, the shown data won't necessarily send to GA4.
The reason is that GTM only forwards the requested data instead of sending it to GA4 directly. To see this behavior, you may have a look at the dev tool such as Chrome dev tool. You can examine the forwarded request's payload in the network tab (search /collect.*/). If it's the recommended event, in payload, there's pr1, pr2, etc., representing your items' array data; otherwise, you'll see nothing, and thus the data won't show up in the GA4 debugging mode.
Do you use the same GTM data layer which initially track for GA Universal events ? If yes, then this may be the cause why the items array did not show on debug view since I found this issue also.
The solution is to create the new GTM Container, and name the data layer differently like 'datalayer2' to differentiate those data layers and set up your config again with 'datalayer2'
for instance, datalayer2.push(
{
event : view_promotion
....}

Can we send multiple Properties in Json of Analytics(IBM MobileFirst)

I was asked for a usecase where I have to filter ActionEvents on type of Page that action is being is being called from.
Example
use case: I have a login page and I have to capture analytics of its events
Can I do something like this
String json = {"PageLevel":"LoginPage","ActionLevel":"LoginButton"};
WLAnalytics analytics=new WLAnalytics();
analytics.log(message, new JSONObject(json));
Will this work... can we create custom chart with first property being ActionLevel and filter it as per PageLevel.
No this will not work. Custom analytics can only be logged in key value pairs i.e. you cannot send two key value pairs in one JSON object. This is a good idea though, I recommend you submit an RFE.
Submit a Feature Request

How to get activities from trello board

I have built a site that pulls the comments from Trello to show it on my site using this code:
var resource = "cards/" + card.id + "/actions";
Trello.get(resource, function(comments) {
if(!$.isEmptyObject(comments)){
var commentStr="<div class='comments_c'>";
$.each(comments, function(c, cda){
//console.log(cda.data.text);
commentStr += "<p>"+cda.data.text+"</p>";
//addComments(cda.data.text);
});
commentStr += "</div>";
}
console.log(commentStr);
Now it works fine to pull the comments but it doesn't show the activity like "Sarah Hastings added this card to ". The api documentation doesn't talk about it and I am at a dead-end. We need it for reporting and looking for a way to get the activities (copied, moved, added) from Trello to our site. Any help is appreciated.
By default, the cards/[idCard]/actions endpoint returns actions filtered to commentCard,updateCard:idList. If you want to get actions of additional types from that endpoint you will want to include the filter parameter with the list of action types that you want returned. You can see the full list of options documented here: https://developers.trello.com/advanced-reference/card#get-1-cards-card-id-or-shortlink-actions by clicking Show next to Arguments for that call.
For example actions of adding cards to a board would be of type: moveCardToBoard so you would want to add that to the filter parameter.

Data not updated in dhtmlx .net scheduler

I have problems and questions about this scheduler. I already tried to build and almost finished it. Although, I receive some errors...
What I do?
I create custom lightbox
mapping all the data in to table dbo.bEvent
I used custom eventbox like this : Scheduler.Templates.event_text = "({position_desc})" + " " + "{newrate}"
position_desc is actually from other table 'dbo.zone'
I create Views in SQL Server to retrieve data from 'newrate'. 'newrate' actually is a new attribute after I do some query to change rate "1000 to 1k" which is new rate save '1k'.
the views that I create by joining table "dbo.zone and dbo.bEvent"
Problem is?
when I save a new data or insert or update new data. my event box just give me '(Undefine)undefine'
all the data that i put in lightbox is save in dbo.bEvent
after I resfresh the page using f5 or navigate to next page or previous page then the data is updated.
Here i attach some screenshot. Thanks in advance
http://s1319.photobucket.com/user/matpyam/library/?sort=3&page=1
If you save the changes as described here http://scheduler-net.com/docs/lightbox.html#define_crud_logic ,
note that the method uses SchedulerFormResponseScript class to render the response.
Constructor takes instance of the event class to be returned to the client. Values of that event will be applied to the related event on the client-side
return (new SchedulerFormResponseScript(action, changedEvent));
make sure object that you send (changedEvent) has all data properties initialized. Basically the event should have the same data as when it is loaded from the Data action.
Alternative solution, which may be more straightforward, would be reload calendar data with the client-side api after saving event:
scheduler.clearAll();
scheduler.load("dataUrl", "json");
http://docs.dhtmlx.com/scheduler/api__scheduler_clearall.html
http://docs.dhtmlx.com/scheduler/api__scheduler_load.html

Ektron Workarea

I need to develop an application that extracts all the contents in Content Tab of the Ektron Workarea and I have to keep tree structure of folders (taxonomies,collections,forms,etc.) also.When I click the content I need to get the Content ID in the code behind also.I need to do all these in a single function.
I tried this requirement with the concept of content block widget in workarea.When we drag that widget and edit it a pop up will come and it displays the folders of work area in tree structure.But when I created an aspx page, put the same code and I browse that page I didn't get the tree structure of all contents.Only the main tabs(Folders,Taxonomies and search ) are visible.Then I drag the user control in the aspx page .But it also doest work.
So how will I solve the above problem.
Can I pull all the contents in tree structure from work area from the root using API codes?.Then can anyone please give the API code to solve?
Please anyone reply!
Assuming you are using 8.6 look here to start with:
http://reference.ektron.com/developer/framework/content/contentmanager/getlist.aspx
Update:
I think I misread your question the first time around. Allow me to expand on my answer a bit. My original answer with the web services assumes that you are rendering the content tree from some sort of "presentation tier" -- a different web site, a console app, or a WPF/WinForms app, etc.
You can get the recursive folder structure with something like this:
private FolderData GetFolderWithChildren(long folderId)
{
var folderApi = new Ektron.Cms.API.Folder();
var folderData = folderApi.GetFolder(folderId);
// This next method is marked as obsolete in v9.0;
// a newer overload is available in v9.0, but I
// don't know if it's available in v8.0
folderData.ChildFolders = folderApi.GetChildFolders(folderId, true);
}
I'm a little confused as to what exactly you're trying to accomplish. If you want to show the entire tree structure graphically, have you tried taking the code and markup from the edit view of the content widget and using it on your non-edit view?
I must say, your requirement that "I need to do all these in a single function" worries me a bit. Workarea content trees can get really large very quickly. If you're trying to load all of the folders and all the taxonomies and all the collections, etc. Then the user will likely be waiting a long time for the page to load, and you risk running into timeout issues.
-- Original Answer --
Ektron v8.0 doesn't have the 3-tier option, which is too bad because that would really make your job a lot easier. In v8.0, there are ASMX web services that you can reference, including:
/workarea/webservices/content.asmx
/workarea/webservices/webserviceapi/user/user.asmx
There are lots more than this; browse through the folders within /workarea/ to see what's available.
It's been a while since I've worked with these services, so I'm a little rusty...
Suppose you add references to those two services I listed above and name them ContentService and UserService. The first thing you'll want to do is set the authentication headers. Then you can call the service methods in much the same way as the old legacy apis.
var contentApi = new ContentService.Content();
contentApi.AuthenticationHeaderValue = new ContentService.AuthenticationHeader();
contentApi.AuthenticationHeaderValue.Username = username;
contentApi.AuthenticationHeaderValue.Password = password;
contentApi.AuthenticationHeaderValue.Domain = domain;
var userApi = new UserService.User();
userApi.AuthenticationHeaderValue = new UserService.AuthenticationHeader();
userApi.AuthenticationHeaderValue.Username = username;
userApi.AuthenticationHeaderValue.Password = password;
userApi.AuthenticationHeaderValue.Domain = domain;
var ud = userApi.GetUserbyUsername("jimmy456");
long folderID = 85;
bool recursive = true;
ContentData[] folderContent = contentApi.GetChildContent(folderID, recursive, "content_id");