Sage CRM - It is possible to create an appointment through Classic ASP code? - sage-crm

Using this:
var NewComm = CRM.CreateRecord("Communication");
NewComm("Comm_ChannelId") = Request.Form("chanId");
NewComm("Comm_Type") = "Appointment";
NewComm("Comm_DateTime") = Request.Form("initialHour");
NewComm.SaveChanges()
I can see in the DDBB that the Communication is created
Just for testing (and to see if it needs a Comm_Link row to be able to show), i updated some row in the Comm_Link table (CmLi_Comm_CommunicationId column) to the ID equals to the Communication i just created, but still i do not see my Comm when clicking in My Calender
There is somethgin else i need to do?

There are certain fields that are required for security, namely Team (Channel) fields and Territory (Secterr) fields.
With Communications, you also need to make sure there are other default fields, as Communicationa are often filtered.
For example, Communication lists are filtered by the Status field = Pending by default, so make sure the comm_status field is set.
Also, all Communications generally have an Action (comm_action) and some other fields.
We advise setting the following fields, in addition to those you have already set:
NewComm("comm_status") = 'Pending';
NewComm("comm_action") = 'Meeting';
NewComm("comm_secterr") = *A Territory Id*;
NewComm("comm_subject") = 'A Subject';
NewComm("Comm_ToDateTime") = *End Date/Time*;
NewCommLink("cmli_comm_userid") = *The User Id*;
NewCommLink("cmli_comm_communicationid") = *The Communication Id*;
NewCommLink("cmli_comm_personid") = *The Person Id if required*;
NewCommLink("cmli_comm_companyid") = *The Company Id if required*;
Hope that helps!
Six Ticks Support

Related

How do I pass a filter to Count?

Is it possible to put a filter into the Issue model whose items are getting counted here????
issues = Student.objects.annotate(Count('issue'))
I really need to filter it so as to get the desired outcome...
If not is there a way I can be able to get count of all Issues to a particular student?
class Issue(SafeDeleteModel):
_safedelete_policy = SOFT_DELETE
borrower_id = models.ForeignKey(Student,on_delete=models.CASCADE)
book_id = models.ForeignKey(Books,on_delete=models.CASCADE)
class Student(models.Model):
school = models.ForeignKey(School, on_delete=models.CASCADE)
name = models.CharField(max_length=200)
student_id = models.CharField(max_length=20)
Yes, you can filter what items are counted with the filter=… parameter [Django-doc]. We can for example filter on the book_id with:
issues = Student.objects.annotate(
num_issues=Count(
'issue',
filter=Q(issue__book_id_id=some_book_id)
)
)
or to exclude soft deleted items, we can work with the deleted field that has been defined in your model (by the django-safedelete package):
issues = Student.objects.annotate(
num_issues=Count(
'issue',
filter=Q(issue__deleted=False)
)
)
Note: Normally one does not add a suffix _ids to a ManyToManyField field, since Django
it refers to a manager over the target objects. Therefore it should
be book, instead of book_id.

PayPal Agreement Amount getting Doubled on Creation Issue

I have an issue with the Paypal Agreement creation. The amount entered is getting doubled in agreement.
PaymentDefinition paymentDefinition = new PaymentDefinition();
paymentDefinition.setName("Regular Payments");
paymentDefinition.setType("REGULAR");
paymentDefinition.setFrequencyInterval("1");
paymentDefinition.setCycles("12");
// Currency
Currency currency = new Currency();
currency.setCurrency("USD");
currency.setValue("5");
paymentDefinition.setAmount(currency);
ChargeModels chargeModels = new ChargeModels();
chargeModels.setType("SHIPPING");
chargeModels.setAmount(currency);
List<ChargeModels> chargeModelsList = new ArrayList<ChargeModels>();
chargeModelsList.add(chargeModels);
paymentDefinition.setChargeModels(chargeModelsList);
MerchantPreferences merchantPreferences = new MerchantPreferences();
merchantPreferences.setSetupFee(currency);
Agreement created image is attached showing double the amount.
Got the answer. I need to remove chargeModels list from paymentDefinition. ChargeModels are just to add miscellaneous charges like shipping/tax. Its added by PayPal examples by default to just show we can add such charges too.

Import TransferOrder lines (InventTransferLine)

I am trying to import a transfer order line with this code from Transfer Orders Import:
InventDim inventDim;
InventTransferLine inventTransferLine;
#define.ShipDate("1/1/2016")
#define.ReceiveDate("1/1/2016")
//Order line
inventDim.clear();
inventDim.InventSiteId = "GENERAL";
inventDim.InventLocationId = "103";
inventTransferLine.clear();
inventTransferLine.initValue();
inventTransferLine.ItemId = "A01103472";
inventTransferLine.InventDimId = InventDim::findOrCreate(inventDim).inventDimId;
inventTransferLine.QtyTransfer = 2;
inventTransferLine.initFromInventTableModule(InventTableModule::find(inventTransferLine.ItemId,ModuleInventPurchSales::Invent));
inventTransferLine.QtyRemainReceive = inventTransferLine.QtyTransfer;
inventTransferLine.QtyRemainShip = inventTransferLine.QtyTransfer;
inventTransferLine.ShipDate = str2Date(#ShipDate, 213);
inventTransferLine.ReceiveDate = str2Date(#ReceiveDate, 213);
inventTransferLine.initFromInventTransferTable(inventTransferTable, false);
inventTransferLine.LineNum = InventTransferLine::lastLineNum(inventTransferLine.TransferId) + 1.0;
if (inventTransferLine.validateWrite())
{
inventTransferLine.insert();
}
else
throw error("Order line");
Is this the correct or the preferred way to do it?
What's the use of inventDim here? I am transferring this product from warehouse A to warehouse B and those are specified in the selected header, meaning the InventTransferTable record.
And i am not sure about these two lines:
1. inventTransferLine.QtyRemainReceive = inventTransferLine.QtyTransfer;
2. inventTransferLine.QtyRemainShip = inventTransferLine.QtyTransfer;
RemainReceive from where? i can't figure out what are they referring to.
You are more or less good to go.
You seems to have copied what others have done, which is good.
There are other ways to it, one using AxInventTransferTable and ...Line classes, another using the TransferOrderCreateService service. None will give you much competitive advantage, if working from within AX.
The InventDim (see white paper) contains the inventory, storage, and tracking dimensions of the item. You will need to set more fields if the item requires it as specified on the item and product.
Product dimensions. Item dimensions, color, size and configuration.
Storage dimensions. These are Site, Warehouse, Location, and Pallet.
Tracking dimensions. These are Batch number and Serial number.
A shipment is a two-step thing. First you ship the item from the source site/warehouse. Later you receive the item at the target site/warehouse.
The QtyRemainShipand QtyRemainReceive fields represents the quantity remaining for each step.

AX 2009: Adjusting User Group Length

We're looking into refining our User Groups in Dynamics AX 2009 into more precise and fine-tuned groupings due to the wide range of variability between specific people within the same department. With this plan, it wouldn't be uncommon for majority of our users to fall user 5+ user groups.
Part of this would involve us expanding the default length of the User Group ID from 10 to 40 (as per Best Practice for naming conventions) since 10 characters don't give us enough room to adequately name each group as we would like (again, based on Best Practice Naming Conventions).
We have found that the main information seems to be obtained from the UserGroupInfo table, but that table isn't present under the Data Dictionary (it's under the System Documentation, so unavailable to be changed that way by my understanding). We've also found the UserGroupName EDT, but that is already set at 40 characters. The form itself doesn't seem to restricting the length of the field either. We've discussed changing the field on the SQL directly, but again my understanding is that if we do a full synchronization it would overwrite this change.
Where can we go to change this particular setting, or is it possible to change?
The size of the user group id is defined as as system extended data type (here \System Documentation\Types\userGroupId) and you cannot change any of the properties including the size 10 length.
You should live with that, don't try to fake the system using direct SQL changes. Even if you did that, AX would still believe that length is 10.
You could change the SysUserInfo form to show the group name only. The groupId might as well be assigned by a number sequence in your context.
I wrote a job to change the string size via X++ and it works for EDTs, but it can't seem to find the "userGroupId". From the general feel of AX I get, I'd be willing to guess that they just have it in a different location, but maybe not. I wonder if this could be tweaked to work:
static void Job9(Args _args)
{
#AOT
TreeNode treeNode;
Struct propertiesExt;
Map mapNewPropertyValues;
void setTreeNodePropertyExt(
Struct _propertiesExt,
Map _newProperties
)
{
Counter propertiesCount;
Array propertyInfoArray;
Struct propertyInfo;
str propertyValue;
int i;
;
_newProperties.insert('IsDefault', '0');
propertiesCount = _propertiesExt.value('Entries');
propertyInfoArray = _propertiesExt.value('PropertyInfo');
for (i = 1; i <= propertiesCount; i++)
{
propertyInfo = propertyInfoArray.value(i);
if (_newProperties.exists(propertyInfo.value('Name')))
{
propertyValue = _newProperties.lookup(propertyInfo.value('Name'));
propertyInfo.value('Value', propertyValue);
}
}
}
;
treeNode = TreeNode::findNode(#ExtendedDataTypesPath);
// This doesn't seem to be able to find the system type
//treeNode = treeNode.AOTfindChild('userGroupId');
treeNode = treeNode.AOTfindChild('AccountCategory');
propertiesExt = treeNode.AOTgetPropertiesExt();
mapNewPropertyValues = new Map(Types::String, Types::String);
mapNewPropertyValues.insert('StringSize', '30');
setTreeNodePropertyExt(propertiesExt, mapNewPropertyValues);
treeNode.AOTsetPropertiesExt(propertiesExt);
treeNode.AOTsave();
info("Done");
}

Need help building a menuopt file for Jenzabar CX

I'm not sure if anyone out here uses Jenzabar & ACE reporting, but the question is specific to that as far as I know.
I'm building an ACE report and the menuopt file for it has to be modified to lookup values for a parameter based on several specific conditions.
The portion of the menuopt file I have now is:
LU7 = crs_rec.title1, optional;
PA7: optional,
comments = "Enter a course number - leave blank if for all"
default = "",
lookup LU7 joining *crs_rec.crs_no,
upshift,
length = 10;
I'm looking to modify the lookup so that it only lists courses that can be found by this SQL statement:
SELECT DISTINCT crs_no
FROM crs_rec
WHERE dept IN ( SELECT dept
FROM dept_table
WHERE div IN ('CCE','HLTH'));
If anyone is familiar with using Jenzabar CX & ACE reporting, any help would be appreciated.
Thanks
I got this answer from someone on a Jenzabar listserv....
Sometimes you can get the same effect by limiting it based on other params.
For example:
LU6 = cat_table.txt;
PA6: optional,
comments = "COMMENT_CAT_TBCODE",
lookup LU6 joining *cat_table.cat,
upshift,
length = 4;
LU7 = crs_rec.title1, optional;
LU7B = crs_rec.dept, optional,
qualifier = "#XXXX,YYYY,ZZZZ,DDDD,EEEE";
LU7C = crs_rec.cat, optional,
qualifier = "field:PA6";
PA7: optional,
comments = "COMMENT_CRS_NO - COMMENT_BLANK_ALL"
default = "",
lookup LU7,LU7B,LU7C joining *crs_rec.crs_no,
upshift,
length = 10;
This would show only the courses in departments XXXX,YYYY,ZZZZ,DDDD, and EEEE in the catalog entered as param PA6.
(the catalog param is basically the only way of doing the "distinct" for the crs_no in the menuopt).
You cannot do the dept in div thing unless you make dept another parameter in which case you could limit the dept selection with a div qualifier and change the LU7B to reference field:xxxx (the param for the dept).

Resources