Is there a way to reference data contained in fields on related record using formula field? - formula

I want to display the taxcode custom field on invoice records
According to Netsuite Help, the format for the formula would be like that:
{taxcode.customfieldid}, knowing that (taxcode is the field id for the taxcode field on the lines of invoice record. customfieldid is the field id for the custom field on the TaxCode record)
PS: customfieldid is a free-text
I have tried possibilities like:
{invoice.item.taxcode.customfieldid}
{item.taxcode.customfieldid}
But I still get this error "ERROR: Field 'taxcode.customfieldid' Not Found"
how can I fix this? Can anyone provide some guidance on this issue?

Generally Netsuite will only look one level away from the record you are on.
In your case you should create a new transaction line field (say custcol_tax_extra) and source that from the taxcode so when a tax code is selected that value is pulled up onto the line.
Then your xml:
<#list record.item as item>${item.custcol_tax_extra}...

Related

Odoo: reference another record by its name in qweb

This is probably really simple, but I'm really tired. Anyway, I am writing custom invoice reports and I need to reference fields that are on the sale order that generated the invoice. This would be easy if they had a relational field, but they don't and I'm not allowed to put one in. The invoice when generated from a sale order has an 'origin' field where it stores the 'name' field of the sale order. I need to reference fields from said sale order via this field. Something along the lines of sale.order.browse('name', '=', o.origin).incoterm <- if incoterm was the field I needed. So anyone can help me with the proper syntax? Or maybe I have the wrong idea?
You can try in this manner,
sale_order = self.pool.get('sale.order')
order_id = sale_order.search(cr,uid,[('name','=',o.orgin)])
if order_id:
sale_obj = sale_order.browse(cr,uid,order_id[0])
then you can use sale_obj with dot notation to access corresponding sale order field value. eg: sale_obj.incoterm

MS CRM 2013 Process Update Account - multiple values to one field

I'm trying to implement an update procedure like the one in this blog post (via extra entity and workflow updating account, triggered when the new entity is being created)
http://www.powerobjects.com/2013/08/01/updating-records-in-microsoft-dynamics-crm/
In my list and the new entity "Account Update" I have 3 fields for the full name of a company (name, name_2, name_3).
In my workflow I want to put these 3 together and combine their values in the Account field "Company" (the company's name).
In the process I tried to insert them via the "Form Assistant" and in the field "Company" I now have the following entry:
{Name(Account Update);Name_2(Account Update);Name_3(Account Update)}
but it doesn't seem to work. After my import and update of the account (which ends successful) the value in "Company" is only the value of the first name field.
Is it possible to combine values?
What exactly does it do, when I choose more than one field in the Form Assistant and say OK?
So at last I figured out how to archive it.
With the "Form Assistant" you can combine or add multiple field values to one new field but it is a bit tricky.
The value in the process update the properies have to look like this:
{Name(Account Update)} {Name_2(Account Update)} {Name_3(Account Update)}
BUT
It does not work if you enter this as text, you have to add the fields one after another so that they are recognized as fields (and marked yellow).
Click into the field (here: "Company").
Then choose the first field in the Form Assistant. Click "Add", choose it in the list below and click "OK". Now the field is in the field "Company".
Now go behind the end of the text in the field make a space and then choose and add the second field (clear the list in the Form Assistant before so that now only the second field is in the list)
So it's right if it looks like:
{Name(Account Update)} {Name_2(Account Update)}
Wrong if looks like following (happens when you keep the first field in the list before adding the second with "OK")
{Name(Account Update);Name_2(Account Update)}

Add new field in the PriceDisc Journal and get it on Salesorder line

I added one field in the Pricedisc journal. Once the TradeAgreement is posted, the field will be updated in the PriceDisc Table.
Now, I need to get the same field on the SalesOrder form based on pricegroup.
Is there any standard way to achieve this?
Have you tried using the Cross Reference tool?
Search how the standard fields are moved.

How to describe (enumerate) picklist enties valid for a specific record type in Salesforce?

In apex code I want to enumerate the legal values for a picklist field. To do this I can just call Account.Foobar__c.getDescribe().getPickListValues() and I've got a list of Schema.PickListEntry values.
However it's possible to setup multiple record types for a given sObject. For example Account might have "Manufacturer", "Distributor" and "Retailer" record types. In the Salesforce setup it is possible edit (limit) the picklist entries for each field based on record type. So Retailer type accounts might only use a subset of the picklist values for the Foobar field.
So basically I want Account.Foobar__c.getDescribe().getPickListValues('Retailer') however this is not the syntax. The validFor method looks promising, but it seems like it is only for field dependent picklists - a picklist filtered only by record type returns false for isDependentPicklist.
I know this is an old post, but maybe the info below will help someone who still needs the answer.
I found here that one can actually get a list of record type specific picklist values by making a describeLayout() call.
Using your example (C#):
DescribeLayoutResult result = binding.describeLayout("Account", new string[] { "01230000000xxXxXXX" } );
PicklistEntry[] values = result.recordTypeMappings[0].picklistsForRecordType[12345].picklistValues;
Replace "01230000000xxXxXXX" with a RecordTypeId of your Retailer record type object. Use the query "SELECT Id FROM RecordType WHERE Name = 'Retailer'" to get the value.
Replace 12345 with an index of your picklist object that you would like to get values of.
You can't do it in pure Apex AFAIK, unfortunately. The metadata API does expose it.
Related opinions: http://boards.developerforce.com/t5/Apex-Code-Development/Any-way-to-obtain-picklist-values-by-record-type/td-p/287563

How can I set a schema.Datetime field to None with Dexterity

I'm writing a simple content type with Dexterity to manage customers, beside the usuals fields, eg name, company, phone...
I've also added a Datetime field to store when the first meeting with
customers has been held, lets call it 'firstmeeting', which I defined
in my interface ICustomers as:
firstmeeting = schema.Datetime(
title=_(u"First Meeting"),
required=False,
)
Now, I notice that when I saved a new Customer document the firstmeeting
field has been filled with the current date even if I don't set any date
in the form, which is not what I want because no meeting with the
customer has been held yet. So I'd like to know how to set a None value
for this field so nothing will be displayed.
I've been trying to use a custom class has explained by Martin Aspeli in
http://plone.org/products/dexterity/documentation/manual/developer-manual/advanced/classes
but I don't know how to check the user input and set None value if nothing
was typed in.
Thanks
Have you tried default=None?
I found out what was happening in my code.
Actually the problem was in the template view.pt where I used toLocalizedTime() function,
which was converting the None value to the current date, so I added a tal:condition to print the date value.
<span id="form-widgets-firstmeeting" class="datetime-widget datetime-field"
tal:condition="context/firstmeeting"
tal:content="python:context.toLocalizedTime(context.firstmeeting)" />

Resources