I'm running into a problem when trying to specify the date format for a signature field using the DSS web service. Here is my code:
Req = new RequestBaseType();
Req.OptionalInputs = new RequestBaseTypeOptionalInputs();
Req.OptionalInputs.SAPISigFieldSettings = new SAPISigFieldSettingsType();
TimeDateFormatType tf = new TimeDateFormatType();
tf.DateFormat = "dd MMM yyyy";
Req.OptionalInputs.SAPISigFieldSettings.TimeFormat = tf;
I attempt to sign the document as follows:
DSS service = new DSS();
service.Url = "https://cosign:8080/sapiws/dss.asmx";
SignRequest sreq = new SignRequest();
sreq.InputDocuments = Req.InputDocuments;
sreq.OptionalInputs = Req.OptionalInputs;
Resp = service.DssSign(sreq);
And I get the following response from the ResponseBaseType object:
urn:oasis:names:tc:dss:1.0:resultmajor:Insufficient Information Error parsing OptionalInput SAPISigFieldSettings
If I don't specify the date format, it works OK. Any ideas?
Even though you want to display just the date and not the time, you need to set TimeFormat to an empty string. It is null by default.
Related
I've been working on a azure project, and I want to create a dataflow using a dynamic filename that contains timestamp.
for example , if the output is a file name 'A' --> 'A_YY-mm-dd_hh_mm_ss'
I already did that on a data factory using this link Here
but in this case I don't know how could I use it.
there is my data flow
The input is an extract file( i did it with a copy data)
You can refer this code. I tried to modify the filenamePrefixForWindow method and I was able to achieve this. These were the changes I made -
public String filenamePrefixForWindow(IntervalWindow window) {
Calendar calendar = Calendar.getInstance();
String year = String.valueOf(calendar.get(Calendar.YEAR));
String month = String.format("%02d",(calendar.get(Calendar.MONTH)+1));
String date = String.format("%02d",calendar.get(Calendar.DATE));
int hh = calendar.get(Calendar.HOUR);
String hour = String.format("%02d",(calendar.get(Calendar.AM_PM) == 0) ? hh:hh+12);
String minute = String.format("%02d",calendar.get(Calendar.MINUTE));
String full_date = year+"-"+month+"-"+date+"-"+hour+"-"+minute;
String prefix =
baseFilename.isDirectory() ? "" : baseFilename.getFilename();
return String.format(
"%s/%s/%s/%s/%s/output-%s", prefix,year,month,date,hour,full_date);
}
I have a use case where there a doc needs to get send from DS and via an API call and we are seeing some weirdness in DS around tagging. In all our templates, the tags for name and title get populated with the same text throughout the document. For example, if I write ‘Obama’ in one of the boxes next to “Name”, every single box in the document for name, title, and even company, gets populated with ‘Obama’. Any ideas?
The DS documents are getting created via the API, and the tags are created like this:
envelope.Tabs = new DocuSignAPI.ArrayOfTab();
envelope.Tabs.Tab = new List<DocuSignAPI.Tab>();
DocuSignAPI.Tab t = new DocuSignAPI.Tab();
t.Type_x = 'Custom';
DocuSignAPI.AnchorTab at = new DocuSignAPI.AnchorTab();
at.AnchorTabString = '\\n1\\';
t.RecipientID = recipient.ID;
t.CustomTabRequired = false;
at.IgnoreIfNotPresent = true;
t.AnchorTabItem = at;
envelope.Tabs.Tab.add(t);
You would have set same dataLabel for all your DS Tags. If you have same datalabel for multiple DS Tags then DocuSign will replicate the same value for all DS Tags.
I'm developing a Sharepoint 2013 Add-in, and I need to retrieve the query string of the original request.
Users are linked to our add-ins from emails and we need to provide some context.
The add-in is requested like this:
https://x.sharepoint.com/MyAddIn?p=10
Is it possible to retrieve the value of p in my add-in?
You could use the following code snippet:
Uri myurl = new Uri(Request.QueryString["SPHostUrl"]);
string param1 = HttpUtility.ParseQueryString(myUri.Query).Get("p");
or use
string param1 = Request.QueryString["p"];
If you want to this via JS, then go on with this
function getQueryStringParameter(paramToRetrieve) {
var params;
var strParams;
params = document.URL.split("?")[1].split("&");
strParams = "";
for (var i = 0; i < params.length; i = i + 1) {
var singleParam = params[i].split("=");
if (singleParam[0] == paramToRetrieve)
return singleParam[1];
}
}
var sProp = decodeURIComponent(getQueryStringParameter("StringProperty1"));
document.write('Value of StringProperty1 : ' + sProp + '</br>');
The SPHostUrl definitely shouldn't contain your parameter, but have you tried #STORM 's other suggestion:
string param1 = Request.QueryString["p"];
Also I think it may be possible to avoid the redirect if you append the built-in add-in query string to the URL you are sending your users like so:
http://<your-app-prefix>.domain.com/<Add In>?SPHostUrl=<host url>&SPAppUrl=<app url>&...&p=10
The add-in's that I've worked on send user's emails with links that require context as well and this method has worked for me.
If this doesn't work, is your add-in a provider-hosted or sharepoint-hosted add-in. This extra info may be helpful.
I've been following the code samples included in Oracle document E15930_01 (Agile PLM Core Web Services User Manual). The samples are in Java, but I've translated what I need to .NET for the project I'm working on.
I can search for an object and return its attachments. I can get all the attachment properties except the one I need, fileDownloadUrl. This field is always blank.
Sample code follows. I thought by setting the property of allFiles to false and downloadUrl to true, I should get a download URL, but I don't. This code returns all the properties for the attachment except the one I want. Any thoughts on what I'm doing wrong?
AttachmentService svc = new AttachmentService();
svc.Credentials = credentials;
AgileGetFileAttachmentRequest[] req2 = InitializeArray<AgileGetFileAttachmentRequest>(1);
AgileFileAttachmentRequestType[] attachments = InitializeArray<AgileFileAttachmentRequestType>(1);
req2[0].classIdentifier = "MyIdentifier";
req2[0].objectNumber = "1234567890";
req2[0].allFiles = false;
req2[0].downloadUrl = true;
req2[0].attachments = attachments;
attachments[0] = new AgileFileAttachmentRequestType();
int rowId = getRowId(tt);
attachments[0].rowId = rowId;
GetFileAttachmentRequestType get = new GetFileAttachmentRequestType();
get.requests = req2;
GetFileAttachmentResponseType resp2 = svc.getFileAttachment(get);
AgileFileAttachmentResponseType[] attchResp = InitializeArray<AgileFileAttachmentResponseType>(1);
attchResp = resp2.responses[0].attachment;
Posting this in case someone else needs to do this or I need to do it later.
I found the data I needed. The download URLs are generated based on XML values in several fields in the database. They're the folder name, filename and FolderVersion on the row you're looking at. You need to parse the XML and retrieve the values to generate the link.
You can get the pattern for the download link through the Get Shortcut button.
I have a plugin where i am creating a new case and I want to send an email out as it is created including its ticketnumber. I have attempted just to call this in the plugin but it is coming back saying that it is not present in the dictionary. I know this field is populated using CRM's own autonumbering so what i'm guessing is happening is that my plugin is firing and creating the case but then i'm trying to use this field before the autonumber has completed.
So is there a way that i can get my plugin to "wait" until this field is available and then use it?
Thanks
EDIT: Code below:
string emailBody = entity.Attributes["description"].ToString();
int bodyLength = emailBody.Length;
int textStart = emailBody.IndexOf(">") + 1;
int newLength = bodyLength - (textStart + 7);
string description = emailBody.Substring(textStart, newLength);
//create complaint
Entity complaint = new Entity("incident");
complaint["description"] = description;
complaint["ts_case_type"] = 717750001;
complaint["ts_registration_datetime"] = DateTime.Now;
complaint["ownerid"] = Owner;
complaint["customerid"] = Organisation;
Service.Create(complaint);
As a side I would suggest sending the email with a workflow if possible, it will be far easier to maintain in the long run and quicker to implement in the short.
In any case to answer your question, from what you have here you need to update your code to retrieve the ticketnumber once you have created the incident. You can do this with a Retrieve message.
For example:
//Create the complaint
Entity complaint = new Entity("incident");
//This is the information that is being sent to the server,
//it will not be updated by CRM with any additional information post creation
complaint["description"] = description;
complaint["ts_case_type"] = 717750001;
complaint["ts_registration_datetime"] = DateTime.Now;
complaint["ownerid"] = Owner;
complaint["customerid"] = Organisation;
//Capture the id of the complaint, we will need this in a moment
Guid complaintId = Service.Create(complaint);
//complaint["ticketnumber"] <-- The server does not populate this information in your object
//Retrieve the ticketnumber from the incident we just created
Entity complaintRetrieved = service.Retrieve("incident", complaintId, new ColumnSet("ticketnumber"));
//Get the ticketnumber
String ticketNumber = (String)complaintRetrieved.Attributes["ticketnumber"];
Like James said in comment, if you just want to send email with some case properties, it is best to do that with workflow (on case create).
In your plugin, ID is generated, and you can get it with:
entity.Attributes["ticketnumber"]